home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / RIncludes / LocationManager.r < prev    next >
Encoding:
Text File  |  1998-08-17  |  6.2 KB  |  171 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        LocationManager.r
  3.  
  4.      Contains:    LocationManager (manages groups of settings)
  5.  
  6.      Version:    Technology:    Mac OS 8
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17.  
  18. #ifndef __LOCATIONMANAGER_R__
  19. #define __LOCATIONMANAGER_R__
  20.  
  21. #ifndef __CONDITIONALMACROS_R__
  22. #include "ConditionalMacros.r"
  23. #endif
  24.  
  25. /* Location Manager API Support -------------------------------------------------------------------- */
  26. /* A Location Token uniquely identifies a Location on a machine... */
  27.  
  28. #define kALMNoLocationToken             (-1)                /*  ALMToken of "off" Location... */
  29. #define kALMLocationNameMaxLen             31                    /*  name (actually imposed by file system)...  */
  30. #define kALMNoLocationIndex             (-1)                /*  index for the "off" Location (kALMNoLocationToken)...  */
  31.  
  32. /* Returned from ALMConfirmName... */
  33. #define kALMConfirmRename                 1
  34. #define kALMConfirmReplace                 2
  35.  
  36. /* ALMConfirmName dialog item numbers for use in callbacks (ALM 2.0)... */
  37.  
  38. #define kALMDuplicateRenameButton         1                    /*  if Window refcon is kALMDuplicateDialogRefCon...  */
  39. #define kALMDuplicateReplaceButton         2
  40. #define kALMDuplicateCancelButton         3
  41. #define kALMDuplicatePromptText         5
  42.  
  43. #define kALMRenameRenameButton             1                    /*  if Window refcon is kALMRenameDialogRefCon...  */
  44. #define kALMRenameCancelButton             2
  45. #define kALMRenameEditText                 3
  46. #define kALMRenamePromptText             4
  47.  
  48. /* Refcons of two windows in ALMConfirmName (ALM 2.0)... */
  49.  
  50. #define kALMDuplicateDialogRefCon         'dupl'
  51. #define kALMRenameDialogRefCon             'rnam'
  52.  
  53. /* Callback routine for Location awareness (mimics AppleEvents) in non-application code... */
  54.  
  55. /* Notification AppleEvents sent to apps/registered code...  */
  56. #define kAELocationChangedNoticeKey     'walk'                /*  Current Location changed...  */
  57. #define kAELocationRescanNoticeKey         'trip'                /*  Location created/renamed/deleted...  */
  58.  
  59. /* ALMSwitchToLocation masks... */
  60.  
  61. #define kALMDefaultSwitchFlags             0x00000000            /*  No special action to take...  */
  62. #define kALMDontShowStatusWindow         0x00000001            /*  Suppress "switching" window...  */
  63. #define kALMSignalViaAE                 0x00000002            /*  Switch by sending Finder AppleEvent...  */
  64.  
  65. /* Parameters for Get/Put/Merge Location calls... */
  66.  
  67. #define kALMAddAllOnSimple                 0                    /*  Add all single-instance, non-action modules...  */
  68. #define kALMAddAllOff                     (-1)                /*  Add all modules but turn them off...  */
  69.  
  70. /* Item numbers for use in Get/Put/Merge Location filters... */
  71.  
  72. #define kALMLocationSelectButton         1
  73. #define kALMLocationCancelButton         2
  74. #define kALMLocationBalloonHelp         3
  75. #define kALMLocationLocationList         7
  76. #define kALMLocationLocationNameEdit     10
  77. #define kALMLocationPromptText             11
  78.  
  79. #define kALMLocationSaveButton             1
  80. /* Location Manager Module API Support ------------------------------------------------------------- */
  81.  
  82. /* ALMGetScriptInfo stuff... */
  83.  
  84. #define kALMScriptInfoVersion             2                    /*  Customarily put in resource for localization...  */
  85. /*
  86.    Alternate form of ScriptInfo is easier to localize in resources; it is used extensively in
  87.    samples and internally, so....
  88. */
  89. #define kALMAltScriptManagerInfoRsrcType  'trip'
  90. #define kALMAltScriptManagerInfoRsrcID     0
  91.  
  92. type kALMAltScriptManagerInfoRsrcType {
  93.     integer;    // version = kALMScriptInfoVersion
  94.     integer;    // scriptCode (eg. smRoman)
  95.     integer;     // regionCode (eg. versUS)
  96.     integer;     // langCode (eg. langEnglish)
  97.     integer;    // fontSize
  98.     pstring;    // fontName
  99. };
  100. /* Reboot information used on ALMSetCurrent (input/output parameter)... */
  101.  
  102. #define kALMNoChange                     0
  103. #define kALMAvailableNow                 1
  104. #define kALMFinderRestart                 2
  105. #define kALMProcesses                     3
  106. #define kALMExtensions                     4
  107. #define kALMWarmBoot                     5
  108. #define kALMColdBoot                     6
  109. #define kALMShutdown                     7
  110.  
  111. /*
  112.    File types and signatures...
  113.    Note: auto-routing of modules will not be supported for 'thng' files...
  114. */
  115.  
  116. #define kALMFileCreator                 'fall'                /*  Creator of Location Manager files...  */
  117. #define kALMComponentModuleFileType     'thng'                /*  Type of a Component Manager Module file [v1.0]...  */
  118. #define kALMComponentStateModuleFileType  'almn'            /*  Type of a CM 'state' Module file...  */
  119. #define kALMComponentActionModuleFileType  'almb'            /*  Type of a CM 'action' Module file...  */
  120. #define kALMCFMStateModuleFileType         'almm'                /*  Type of a CFM 'state' Module file...  */
  121. #define kALMCFMActionModuleFileType     'alma'                /*  Type of a CFM 'action' Module file...  */
  122.  
  123. /* Component Manager 'thng' info... */
  124.  
  125. #define kALMComponentRsrcType             'thng'
  126. #define kALMComponentType                 'walk'
  127.  
  128. /* CFM Modules require a bit of information (replacing some of the 'thng' resource)... */
  129.  
  130. #define kALMModuleInfoRsrcType             'walk'
  131. #define kALMModuleInfoOriginalVersion     0
  132.  
  133. type kALMModuleInfoRsrcType {
  134.     switch {
  135.         case Original:
  136.             key longint = kALMModuleInfoOriginalVersion;
  137.             literal longint;         // Subtype
  138.             literal longint;         // Manufacturer
  139.             unsigned hex longint;     // Flags
  140.     };
  141. };
  142. /* These masks apply to the "Flags" field in the 'thng' or 'walk' resource... */
  143.  
  144. #define kALMMultiplePerLocation         0x00000001            /*  Module can be added more than once to a Location...  */
  145. #define kALMDescriptionGetsStale         0x00000002            /*  Descriptions may change though the setting didn't...   */
  146.  
  147. /* Misc stuff for older implementations ------------------------------------------------------------ */
  148.  
  149. /* Old error codes for compatibility - new names are in Errors interface... */
  150. #if OLDROUTINENAMES
  151. #define ALMInternalErr                     (-30049)            /*  use kALMInternalErr  */
  152. #define ALMLocationNotFound             (-30048)            /*  use kALMLocationNotFoundErr  */
  153. #define ALMNoSuchModuleErr                 (-30047)            /*  use kALMNoSuchModuleErr  */
  154. #define ALMModuleCommunicationErr         (-30046)            /*  use kALMModuleCommunicationErr  */
  155. #define ALMDuplicateModuleErr             (-30045)            /*  use kALMDuplicateModuleErr  */
  156. #define ALMInstallationErr                 (-30044)            /*  use kALMInstallationErr  */
  157. #define ALMDeferSwitchErr                 (-30043)            /*  use kALMDeferSwitchErr  */
  158.  
  159. /* Old ALMConfirmName constants... */
  160.  
  161. #define ALMConfirmRenameConfig             1
  162. #define ALMConfirmReplaceConfig         2
  163.  
  164. /* Old AppleEvents... */
  165.  
  166. #define kAELocationNotice                 'walk'
  167. #endif
  168.  
  169. #endif /* __LOCATIONMANAGER_R__ */
  170.  
  171.